package com.example.therDays.ui.components


import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.runtime.Composable
import com.example.therDays.ui.navigation.Navigation
import com.example.therDays.ui.screens.HomeFrame
import com.example.therDays.ui.screens.Weather
import com.google.accompanist.navigation.animation.AnimatedNavHost
import com.google.accompanist.navigation.animation.composable
import com.google.accompanist.navigation.animation.rememberAnimatedNavController

@OptIn(ExperimentalAnimationApi::class)
@Composable
fun NavigationHost() {
    val animatedNavController = rememberAnimatedNavController()

    AnimatedNavHost(
        navController = animatedNavController,
        startDestination = Navigation.HomeFrame.router
    ){
        composable(Navigation.HomeFrame.router){
            HomeFrame(
                NavWeather = { animatedNavController.navigate(Navigation.Weather.router) }
            )
        }
        composable(Navigation.Weather.router){
            Weather(
                NavPop={animatedNavController.popBackStack()
                }
            )
        }

    }

}


